package com.gemme.gemme.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;

import com.gemme.gemme.R;
import com.google.android.material.tabs.TabLayout;

public class BrandListMiddleView extends RelativeLayout {
    private Context context;

    public BrandListMiddleView(Context context) {
        this(context, null);
    }

    public BrandListMiddleView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BrandListMiddleView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        initView();
    }

    String[] titleS = {"推荐", "热销", "价格", "折扣"};
    TabLayout tabLayout;

    private void initView() {
        LayoutInflater.from(context).inflate(R.layout.brand_list_middle, this);

        tabLayout = findViewById(R.id.tablayout);
        for (int i = 0; i < titleS.length; i++) {
            tabLayout.addTab(tabLayout.newTab());
            tabLayout.getTabAt(i).setText(titleS[i]);
        }

        /*for (int i = 0; i < titleS.length; i++) {
            tabLayout.getTabAt(i).setText(titleS[i]);
        }*/
    }

    public TabLayout getTabLayout() {
        return tabLayout;
    }

    public void setBrandLogo(String brandLogo) {

    }
}




